/*
 * Copyright 2012 ITC Tsinghua University. All Rights Reserved.
 */
package cn.edu.tsinghua.cic.ccss.dto;

import java.util.Date;

import org.forten.core.dto.GeneralDto;
import org.forten.utils.common.StringUtil;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * 
 * @since 2012-5-10
 */
public class CourseDto implements GeneralDto {

	private static final long serialVersionUID = -580352492864302168L;
	private long id;
	private String num; // 课程号
	private String name;// 课程名称
	private String state;// 课程状态
	private Date teachTime;// 上课时间
	private String teachTimeDescription;// 上课时间描述
	private String classroom;// 上课地点
	private String courseInfo;// 课程简介
	private String type;// 课程类型
	private String teacherName;// 上课教师姓名
	private String teacherInfo;// 上课教师简介
	private String headTeacherName;// 班主任姓名
	private String headTeacherEmail;// 班主任邮箱
	private String headTeacherPhone;// 班主任手机号码
	private String otherInfo;// 其他说明
	private int classCapacity;// 课容量
	private int classChosenNum;// 已选课人数
	private int credit;// 学时
	private Date startTimeChoose;// 开始选课时间
	private Date endTimeChoose;// 选课结束时间
	private String sendMessageFlag;// 短信息是否已发送
	private String sendEmailFlag;// 邮件是否已方式
	private String memo;// 备注

	public CourseDto() {

	}

	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @return the num
	 */
	public String getNum() {
		return num;
	}

	/**
	 * @param num
	 *            the num to set
	 */
	public void setNum(String num) {
		if (StringUtil.hasText(num))
			this.num = num.trim();
		else
			this.num = "";
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		if (StringUtil.hasText(name))
			this.name = name.trim();
		else
			this.name = "";
	}

	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		if (StringUtil.hasText(state))
			this.state = state.trim();
		else
			this.state = "";
	}

	/**
	 * @return the teachTime
	 */
	public Date getTeachTime() {
		return teachTime;
	}

	/**
	 * @param teachTime
	 *            the teachTime to set
	 */
	public void setTeachTime(Date teachTime) {
		this.teachTime = teachTime;
	}

	/**
	 * @return the teachTimeDescription
	 */
	public String getTeachTimeDescription() {
		return teachTimeDescription;
	}

	/**
	 * @param teachTimeDescription
	 *            the teachTimeDescription to set
	 */
	public void setTeachTimeDescription(String teachTimeDescription) {
		if (StringUtil.hasText(teachTimeDescription))
			this.teachTimeDescription = teachTimeDescription.trim();
		else
			this.teachTimeDescription = "";
	}

	/**
	 * @return the classroom
	 */
	public String getClassroom() {
		return classroom;
	}

	/**
	 * @param classroom
	 *            the classroom to set
	 */
	public void setClassroom(String classroom) {
		if (StringUtil.hasText(classroom))
			this.classroom = classroom.trim();
		else
			this.classroom = "";
	}

	/**
	 * @return the courseInfo
	 */
	public String getCourseInfo() {
		return courseInfo;
	}

	/**
	 * @param courseInfo
	 *            the courseInfo to set
	 */
	public void setCourseInfo(String courseInfo) {
		if (StringUtil.hasText(courseInfo))
			this.courseInfo = courseInfo.trim();
		else
			this.courseInfo = "";
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		if (StringUtil.hasText(type))
			this.type = type.trim();
		else
			this.type = "";
	}

	/**
	 * @return the teacherName
	 */
	public String getTeacherName() {
		return teacherName;
	}

	/**
	 * @param teacherName
	 *            the teacherName to set
	 */
	public void setTeacherName(String teacherName) {
		if (StringUtil.hasText(teacherName))
			this.teacherName = teacherName.trim();
		else
			this.teacherName = "";
	}

	/**
	 * @return the teacherInfo
	 */
	public String getTeacherInfo() {
		return teacherInfo;
	}

	/**
	 * @param teacherInfo
	 *            the teacherInfo to set
	 */
	public void setTeacherInfo(String teacherInfo) {
		if (StringUtil.hasText(teacherInfo))
			this.teacherInfo = teacherInfo.trim();
		else
			this.teacherInfo = "";
	}

	/**
	 * @return the headTeacherName
	 */
	public String getHeadTeacherName() {
		return headTeacherName;
	}

	/**
	 * @param headTeacherName
	 *            the headTeacherName to set
	 */
	public void setHeadTeacherName(String headTeacherName) {
		if (StringUtil.hasText(headTeacherName))
			this.headTeacherName = headTeacherName.trim();
		else
			this.headTeacherName = "";
	}

	/**
	 * @return the headTeacherEmail
	 */
	public String getHeadTeacherEmail() {
		return headTeacherEmail;
	}

	/**
	 * @param headTeacherEmail
	 *            the headTeacherEmail to set
	 */
	public void setHeadTeacherEmail(String headTeacherEmail) {
		if (StringUtil.hasText(headTeacherEmail))
			this.headTeacherEmail = headTeacherEmail.trim();
		else
			this.headTeacherEmail = "";
	}

	/**
	 * @return the headTeacherPhone
	 */
	public String getHeadTeacherPhone() {
		return headTeacherPhone;
	}

	/**
	 * @param headTeacherPhone
	 *            the headTeacherPhone to set
	 */
	public void setHeadTeacherPhone(String headTeacherPhone) {
		if (StringUtil.hasText(headTeacherPhone))
			this.headTeacherPhone = headTeacherPhone.trim();
		else
			this.headTeacherPhone = "";
	}

	/**
	 * @return the otherInfo
	 */
	public String getOtherInfo() {
		return otherInfo;
	}

	/**
	 * @param otherInfo
	 *            the otherInfo to set
	 */
	public void setOtherInfo(String otherInfo) {
		if (StringUtil.hasText(otherInfo))
			this.otherInfo = otherInfo.trim();
		else
			this.otherInfo = "";
	}

	/**
	 * @return the classCapacity
	 */
	public int getClassCapacity() {
		return classCapacity;
	}

	/**
	 * @param classCapacity
	 *            the classCapacity to set
	 */
	public void setClassCapacity(int classCapacity) {
		this.classCapacity = classCapacity;
	}

	/**
	 * @return the classChosenNum
	 */
	public int getClassChosenNum() {
		return classChosenNum;
	}

	/**
	 * @param classChosenNum
	 *            the classChosenNum to set
	 */
	public void setClassChosenNum(int classChosenNum) {
		this.classChosenNum = classChosenNum;
	}

	/**
	 * @return the credit
	 */
	public int getCredit() {
		return credit;
	}

	/**
	 * @param credit
	 *            the credit to set
	 */
	public void setCredit(int credit) {
		this.credit = credit;
	}

	/**
	 * @return the startTimeChoose
	 */
	public Date getStartTimeChoose() {
		return startTimeChoose;
	}

	/**
	 * @param startTimeChoose
	 *            the startTimeChoose to set
	 */
	public void setStartTimeChoose(Date startTimeChoose) {
		this.startTimeChoose = startTimeChoose;
	}

	/**
	 * @return the endTimeChoose
	 */
	public Date getEndTimeChoose() {
		return endTimeChoose;
	}

	/**
	 * @param endTimeChoose
	 *            the endTimeChoose to set
	 */
	public void setEndTimeChoose(Date endTimeChoose) {
		this.endTimeChoose = endTimeChoose;
	}

	/**
	 * @return the sendMessageFlag
	 */
	public String getSendMessageFlag() {
		return sendMessageFlag;
	}

	/**
	 * @param sendMessageFlag
	 *            the sendMessageFlag to set
	 */
	public void setSendMessageFlag(String sendMessageFlag) {
		if (StringUtil.hasText(sendMessageFlag))
			this.sendMessageFlag = sendMessageFlag.trim();
		else
			this.sendMessageFlag = "";
	}

	/**
	 * @return the sendEmailFlag
	 */
	public String getSendEmailFlag() {
		return sendEmailFlag;
	}

	/**
	 * @param sendEmailFlag
	 *            the sendEmailFlag to set
	 */
	public void setSendEmailFlag(String sendEmailFlag) {
		if (StringUtil.hasText(sendEmailFlag))
			this.sendEmailFlag = sendEmailFlag.trim();
		else
			this.sendEmailFlag = "";
	}

	/**
	 * @return the memo
	 */
	public String getMemo() {
		return memo;
	}

	/**
	 * @param memo
	 *            the memo to set
	 */
	public void setMemo(String memo) {
		if (StringUtil.hasText(memo))
			this.memo = memo.trim();
		else
			this.memo = "";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (id ^ (id >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CourseDto other = (CourseDto) obj;
		if (id != other.id)
			return false;
		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "CourseDto [id=" + id + ", num=" + num + ", name=" + name
				+ ", state=" + state + ", teachTime=" + teachTime
				+ ", teachTimeDescription=" + teachTimeDescription
				+ ", classroom=" + classroom + ", courseInfo=" + courseInfo
				+ ", type=" + type + ", teacherName=" + teacherName
				+ ", teacherInfo=" + teacherInfo + ", headTeacherName="
				+ headTeacherName + ", headTeacherEmail=" + headTeacherEmail
				+ ", headTeacherPhone=" + headTeacherPhone + ", otherInfo="
				+ otherInfo + ", classCapacity=" + classCapacity
				+ ", classChosenNum=" + classChosenNum + ", credit=" + credit
				+ ", startTimeChoose=" + startTimeChoose + ", endTimeChoose="
				+ endTimeChoose + ", sendMessageFlag=" + sendMessageFlag
				+ ", sendEmailFlag=" + sendEmailFlag + ", memo=" + memo + "]";
	}
}
